package com.txzt.gaea.flow.service.impl;

import com.txzt.gaea.common.base.service.impl.BaseServiceImpl;
import com.txzt.gaea.common.core.base.context.AdminUserContext;
import com.txzt.gaea.flow.model.FlowStepLog;
import com.txzt.gaea.flow.service.IFlowStepLogService;
import com.txzt.gaea.vo.AdminUserVO;
import org.springframework.stereotype.Service;

import java.util.Date;


@Service
public class FlowStepLogServiceImpl extends BaseServiceImpl<FlowStepLog> implements IFlowStepLogService {

    @Override
    public int insertFlowStepLog(Long flowId, Long flowStepId, String operateName, Integer operateType,
                                 String operateComment, String ccUser,String eSignature) {
        AdminUserVO adminUserVO = AdminUserContext.getUser();
        FlowStepLog flowStepLog = new FlowStepLog();
        flowStepLog.setFlowId(flowId);
        flowStepLog.setFlowStepId(flowStepId);
        flowStepLog.setOperateName(operateName);
        flowStepLog.setOperateType(operateType);
        flowStepLog.setOperateComment(operateComment);
        flowStepLog.setESignature(eSignature);
        flowStepLog.setOperator(adminUserVO.getId());
        flowStepLog.setOperateTime(new Date());
        flowStepLog.setCcUser(ccUser);
        return sqlManager.insertTemplate(flowStepLog);
    }
}
